<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The IntlRuleBasedBreakIterator class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="intlbreakiterator.settext.html">« IntlBreakIterator::setText</a></li>
      <li style="float: right;"><a href="intlrulebasedbreakiterator.construct.html">IntlRuleBasedBreakIterator::__construct »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="book.intl.html">intl</a></li>
    <li>The IntlRuleBasedBreakIterator class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.intlrulebasedbreakiterator" class="reference">

 <h1 class="title">The IntlRuleBasedBreakIterator class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8)</p>


  <div class="section" id="intlrulebasedbreakiterator.intro">
   <h2 class="title">简介</h2>
   <p class="para">
    A subclass of <span class="classname"><a href="class.intlbreakiterator.html" class="classname">IntlBreakIterator</a></span> that encapsulates
    ICU break iterators whose behavior is specified using a set of rules. This
    is the most common kind of break iterators.
   </p>
   <p class="para">
    These rules are described in the <a href="http://userguide.icu-project.org/boundaryanalysis#TOC-RBBI-Rules" class="link external">&raquo;&nbsp;ICU Boundary Analysis
    User Guide</a>.
   </p>
  </div>


  <div class="section" id="intlrulebasedbreakiterator.synopsis">
   <h2 class="title">类摘要</h2>


   <div class="classsynopsis">
    <div class="ooclass">
     
    </div>

    <div class="classsynopsisinfo">
     <span class="ooclass">
      <span class="modifier">class</span> <strong class="classname">IntlRuleBasedBreakIterator</strong>
     </span>

     <span class="ooclass">
      <span class="modifier">extends</span>
       <a href="class.intlbreakiterator.html" class="classname">IntlBreakIterator</a>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的常量 */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.done"><var class="varname">IntlBreakIterator::DONE</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-none"><var class="varname">IntlBreakIterator::WORD_NONE</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-none-limit"><var class="varname">IntlBreakIterator::WORD_NONE_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-number"><var class="varname">IntlBreakIterator::WORD_NUMBER</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-number-limit"><var class="varname">IntlBreakIterator::WORD_NUMBER_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-letter"><var class="varname">IntlBreakIterator::WORD_LETTER</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-letter-limit"><var class="varname">IntlBreakIterator::WORD_LETTER_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-kana"><var class="varname">IntlBreakIterator::WORD_KANA</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-kana-limit"><var class="varname">IntlBreakIterator::WORD_KANA_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-ideo"><var class="varname">IntlBreakIterator::WORD_IDEO</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.word-ideo-limit"><var class="varname">IntlBreakIterator::WORD_IDEO_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-soft"><var class="varname">IntlBreakIterator::LINE_SOFT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-soft-limit"><var class="varname">IntlBreakIterator::LINE_SOFT_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-hard"><var class="varname">IntlBreakIterator::LINE_HARD</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.line-hard-limit"><var class="varname">IntlBreakIterator::LINE_HARD_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-term"><var class="varname">IntlBreakIterator::SENTENCE_TERM</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-term-limit"><var class="varname">IntlBreakIterator::SENTENCE_TERM_LIMIT</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-sep"><var class="varname">IntlBreakIterator::SENTENCE_SEP</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type">int</span>
      <var class="fieldsynopsis_varname"><a href="class.intlbreakiterator.html#intlbreakiterator.constants.sentence-sep-limit"><var class="varname">IntlBreakIterator::SENTENCE_SEP_LIMIT</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 方法 */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="intlrulebasedbreakiterator.construct.html" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$rules</code></span>, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$compiled</code><span class="initializer"> = <strong><code>false</code></strong></span></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlrulebasedbreakiterator.getbinaryrules.html" class="methodname">getBinaryRules</a></span>(): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlrulebasedbreakiterator.getrules.html" class="methodname">getRules</a></span>(): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlrulebasedbreakiterator.getrulestatus.html" class="methodname">getRuleStatus</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlrulebasedbreakiterator.getrulestatusvec.html" class="methodname">getRuleStatusVec</a></span>(): <span class="type"><span class="type">array</span>|<span class="type"><span class="type false">false</span></span></span></div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* 继承的方法 */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="intlbreakiterator.createcharacterinstance.html" class="methodname">IntlBreakIterator::createCharacterInstance</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$locale</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type">?</span><span class="type"><a href="class.intlbreakiterator.html" class="type IntlBreakIterator">IntlBreakIterator</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="intlbreakiterator.createcodepointinstance.html" class="methodname">IntlBreakIterator::createCodePointInstance</a></span>(): <span class="type"><a href="class.intlcodepointbreakiterator.html" class="type IntlCodePointBreakIterator">IntlCodePointBreakIterator</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="intlbreakiterator.createlineinstance.html" class="methodname">IntlBreakIterator::createLineInstance</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$locale</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type">?</span><span class="type"><a href="class.intlbreakiterator.html" class="type IntlBreakIterator">IntlBreakIterator</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="intlbreakiterator.createsentenceinstance.html" class="methodname">IntlBreakIterator::createSentenceInstance</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$locale</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type">?</span><span class="type"><a href="class.intlbreakiterator.html" class="type IntlBreakIterator">IntlBreakIterator</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="intlbreakiterator.createtitleinstance.html" class="methodname">IntlBreakIterator::createTitleInstance</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$locale</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type">?</span><span class="type"><a href="class.intlbreakiterator.html" class="type IntlBreakIterator">IntlBreakIterator</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="intlbreakiterator.createwordinstance.html" class="methodname">IntlBreakIterator::createWordInstance</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">string</span><span class="type"></span></span> <code class="parameter">$locale</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type"><span class="type">?</span><span class="type"><a href="class.intlbreakiterator.html" class="type IntlBreakIterator">IntlBreakIterator</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.current.html" class="methodname">IntlBreakIterator::current</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.first.html" class="methodname">IntlBreakIterator::first</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.following.html" class="methodname">IntlBreakIterator::following</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.geterrorcode.html" class="methodname">IntlBreakIterator::getErrorCode</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>intl_get_error_code</strong></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.geterrormessage.html" class="methodname">IntlBreakIterator::getErrorMessage</a></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="methodname"><strong>intl_get_error_message</strong></span>(): <span class="type">string</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.getlocale.html" class="methodname">IntlBreakIterator::getLocale</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$type</code></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.getpartsiterator.html" class="methodname">IntlBreakIterator::getPartsIterator</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$type</code><span class="initializer"> = IntlPartsIterator::KEY_SEQUENTIAL</span></span>): <span class="type"><a href="class.intlpartsiterator.html" class="type IntlPartsIterator">IntlPartsIterator</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.gettext.html" class="methodname">IntlBreakIterator::getText</a></span>(): <span class="type"><span class="type">?</span><span class="type">string</span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.isboundary.html" class="methodname">IntlBreakIterator::isBoundary</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>): <span class="type">bool</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.last.html" class="methodname">IntlBreakIterator::last</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.next.html" class="methodname">IntlBreakIterator::next</a></span>(<span class="methodparam"><span class="type">?</span><span class="type"><span class="type">int</span><span class="type"></span></span> <code class="parameter">$offset</code><span class="initializer"> = <strong><code>null</code></strong></span></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.preceding.html" class="methodname">IntlBreakIterator::preceding</a></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$offset</code></span>): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.previous.html" class="methodname">IntlBreakIterator::previous</a></span>(): <span class="type">int</span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="intlbreakiterator.settext.html" class="methodname">IntlBreakIterator::setText</a></span>(<span class="methodparam"><span class="type">string</span> <code class="parameter">$text</code></span>): <span class="type"><span class="type">?</span><span class="type">bool</span></span></div>

   }</div>


  </div>

 </div>

 




























<h2>目录</h2><ul class="chunklist chunklist_reference"><li><a href="intlrulebasedbreakiterator.construct.html">IntlRuleBasedBreakIterator::__construct</a> — Create iterator from ruleset</li><li><a href="intlrulebasedbreakiterator.getbinaryrules.html">IntlRuleBasedBreakIterator::getBinaryRules</a> — Get the binary form of compiled rules</li><li><a href="intlrulebasedbreakiterator.getrules.html">IntlRuleBasedBreakIterator::getRules</a> — Get the rule set used to create this object</li><li><a href="intlrulebasedbreakiterator.getrulestatus.html">IntlRuleBasedBreakIterator::getRuleStatus</a> — Get the largest status value from the break rules that determined the current break position</li><li><a href="intlrulebasedbreakiterator.getrulestatusvec.html">IntlRuleBasedBreakIterator::getRuleStatusVec</a> — Get the status values from the break rules that determined the current break position</li></ul>
</div>
</div></div></body></html>